package com.xsq.dubbo.dubboprovidera.serviceimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.dubbo.rpc.RpcContext;
import com.xsq.dubbo.api.DubboService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;

/**
 * @ClassName DubboServiceAImpl
 * @Description TODO
 * @Author xsq
 * @Date 2020/6/23 14:07
 **/
@Service
@Slf4j
public class DubboServiceAImpl implements DubboService {

    @Value("${server.port}")
    private String prot;

    @Override
    public String test() {
        String ip = RpcContext.getContext().getAttachment("ip");
        System.out.println(ip);
        return "消费者ip地址" + ip + "我是测试端口：" + prot;
    }
}
